% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/datadoc_namevalues.R
\docType{data}
\name{namevalue}
\alias{namevalue}
\alias{race_key}
\alias{gender_key}
\alias{educ_key}
\alias{age5_key}
\alias{age10_key}
\alias{states_key}
\title{CCES-ACS variable key value pairs for recoding}
\format{
All keys are tibbles with one row per recoding value.

\subsection{\code{race_key}}{

\describe{
\item{race}{An labelled integer of class haven::labelled.
Most compact form of both sources and the values both will get recoded
to in MRP.}
\item{race_cces}{Labelled versions of the CCES race codings. These are of the
same class as the CCES cumulative file.}
\item{race_cces_chr}{Labels for the first column, in characters}
\item{race_acs}{Corresponding character in the ACS data via the tidycensus package}
\item{race_num}{A numeric value underlying the \code{race} label.}
}
}

\subsection{\code{gender_key}:}{

\describe{
\item{gender}{An labelled integer of class haven::labelled. Target variable}
\item{gender_chr}{Character to recode from. CCES and ACS use the same values.}
}
}

\subsection{\code{educ_key}}{

For mapping ACS data values for education e.g. in \link{get_acs_cces}:
\describe{
\item{educ_cces_chr}{Character to recode from, in CCES}
\item{educ_chr}{Character to recode from, in ACS.}
\item{educ}{An labelled integer of class haven::labelled. Target variable}
}
}

\subsection{\code{age5_key}}{

Age bins, 5-ways, used in \link{acscodes_age_sex_educ}. Use \link{ccc_bin_age}
to recode CCES variable
\describe{
\item{age}{An labelled integer of class haven::labelled. Target variable.}
\item{age_chr}{Character to recode from, in ACS}
}
}

\subsection{\code{age10_key}: Age bins, 10-ways, used in \link{acscodes_age_sex_race}:}{

\describe{
\item{age}{An labelled integer of class \code{haven::haven_labelled}. Target variable.}
\item{age_chr}{Character to recode from, in ACS}
}
}

\subsection{\code{states_key}: State codes and regions:}{

\describe{
\item{st}{State two-letter abbreviation \code{state.abb}}
\item{state}{State full name via \code{state.name}}
\item{st_trad}{State traditional abbreviation following AP style}
\item{st_fips}{Integer, state FIPS code}
\item{region}{Census region (Northeast, Midwest, South, West)}
\item{division}{Census division (New England, Middle Atlantic,
South Atlantic, East South Central, West South Central,
East North Central, "West North Central, Mountain, Pacific)}
}
}
}
\usage{
race_key

gender_key

educ_key

age5_key

age10_key

states_key
}
\description{
These value-value tables are useful for recoding the values of
from one dataset (CCES) so that they can be merged immediately with another
(ACS).  These get used internally in \link{ccc_std_demographics}, but they are
available as built in datasets.
}
\details{
These tibbles themselves are not key-values pair in a strict sense because
the dataframe tries to have two recodes CCES to common and ACS to common and so for
a given recode, rows are not distinct. To avoid duplicating rows inadvertently,
use the \code{dplyr::distinct} to reduce the key to two columns with unique rows.
}
\examples{
 library(ccesMRPprep)
 race_key
 educ_key
 gender_key
 age5_key
 age10_key
 states_key
}
\keyword{datasets}
